package com.linchong.concurrency.chapter8;

/**
 * @Author:linchong
 * @CreateTime:2020-01-07 09:35
 * @Description:
 */
public class OtherService {
	private final Object lock = new Object();

	private DeadLock deadLock;

	public void s1() {
		synchronized (lock) {
			System.out.println("s1===>");
		}
	}

	public void s2() {
		synchronized (lock) {
			System.out.println("s2===>");
			deadLock.m2();
		}
	}

	public void setDeadLock(DeadLock deadLock) {
		this.deadLock = deadLock;
	}
}
